﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WLYT.Domain.ApiModel
{
    public class EA_Head
    {
        public int PID { get; set; }

        /// <summary>
        /// 单据类型
        /// </summary>
        public string doc_type { get; set; }

        /// <summary>
        /// 单号
        /// </summary>
        public string doc_num { get; set; }

        /// <summary>
        /// 仓库编码
        /// </summary>
        public string ware_code { get; set; }

        /// <summary>
        /// 工单号 ,单据类型为C002盘点出库时，为空
        /// </summary>
        public string project_id { get; set; }

        /// <summary>
        /// 供应商编码
        /// </summary>
        public string supplier_code { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        public string supplier_name { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime CreateDt { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        public string CreateUser { get; set; }

        public List<EA_Detail> Details { get; set; }
    }


    public class EA_Detail
    {
        public int PID { get; set; }

        /// <summary>
        /// OrderId
        /// </summary>
        public int HeadPid { get; set; }

        /// <summary>
        /// 单号
        /// </summary>
        public string doc_num { get; set; }

        /// <summary>
        /// 入库ID
        /// </summary>
        public string inBoundMaterialId { get; set; }

        /// <summary>
        /// 出库ID
        /// </summary>
        public string outBoundMaterialId { get; set; }

        /// <summary>
        /// 仓库编码
        /// </summary>
        public string ware_code { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string item_code { get; set; }

        /// <summary>
        /// 制造商名称
        /// </summary>
        public string mader_code { get; set; }

        /// <summary>
        /// 制造商名称
        /// </summary>
        public string mader_name { get; set; }

        /// <summary>
        /// 物料描述
        /// </summary>
        public string item_desc { get; set; }

        /// <summary>
        /// 物料描述
        /// </summary>
        public string item_name { get; set; }

        public int ItemMinPack { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string unit_code { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int recv_qty { get; set; }

        /// <summary>
        /// 原厂料号
        /// </summary>
        public string original_code { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public string Status_Flag
        {
            get
            {
                switch (Status)
                {
                    case 0:
                        return "初始化";
                    case 1:
                        return "进行中";
                    case 2:
                        return "已完成";
                    default:
                        return "进行中";
                }

            }
        }

        /// <summary>
        /// 读码数量
        /// </summary>
        public int dm_qty { get; set; }

        /// <summary>
        /// BRAND
        /// </summary>
        public string BRAND { get; set; }

        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime CreateDt { get; set; }

        public List<PostDetailEntiy> PostDetails { get; set; }
    }

    public class PostDetailEntiy
    {
        public int PID { get; set; }

        /// <summary>
        /// OrderId
        /// </summary>
        public int HeadPid { get; set; }

        /// <summary>
        /// OrderItemId
        /// </summary>
        public int MID { get; set; }

        /// <summary>
        /// 原厂QR码
        /// </summary>
        public string OriginalQR1 { get; set; }

        /// <summary>
        /// 原厂QR码2
        /// </summary>
        public string OriginalQR2 { get; set; }

        /// <summary>
        /// 原厂一维码
        /// </summary>
        public string OriginalBar { get; set; }

        /// <summary>
        /// 内部标签
        /// </summary>
        public string CustomerQR1 { get; set; }

        /// <summary>
        /// 旧二维码
        /// </summary>
        public string OrigLabelId { get; set; }

        /// <summary>
        /// 机器编号
        /// </summary>
        public string MachineNo { get; set; }

        /// <summary>
        /// 贴标状态
        /// </summary>
        public int Zt { get; set; }

        public int Status { get; set; }

        /// <summary>
        /// PartNo
        /// </summary>
        public string PartNo { get; set; }

        /// <summary>
        /// QTY
        /// </summary>
        public int QTY { get; set; }

        /// <summary>
        /// LotNo
        /// </summary>
        public string LotNo { get; set; }

        /// <summary>
        /// DateCode
        /// </summary>
        public string DateCode { get; set; }

        /// <summary>
        /// 操作员
        /// </summary>
        public string Czy { get; set; }

        /// <summary>
        /// 打标时间
        /// </summary>
        public DateTime CreateDt { get; set; }

        /// <summary>
        /// 图片存储
        /// </summary>
        public string Picture { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string ITEM_CODE { get; set; }

        /// <summary>
        /// 上传
        /// </summary>
        public bool IsUpLoad { get; set; }

        /// <summary>
        /// 数据来源
        /// </summary>
        public string DataFrom { get; set; }
    }

    public class ApiQueryModel
    {
        /// <summary>
        /// 单号
        /// </summary>
        public string DocNum { get; set; }
        /// <summary>
        /// 内部标签
        /// </summary>
        public string LabelId { get; set; }

        /// <summary>
        /// 失败信息
        /// </summary>
        public string ErrorMsg { get; set; }
    }
}
